package by.dvrudenko.avtobaza.services;

import java.util.List;

import javax.persistence.metamodel.SingularAttribute;

import org.springframework.transaction.annotation.Transactional;

import by.dvrudenko.avtobaza.datamodel.User;
import by.dvrudenko.avtobaza.datamodel.enums.UserRole;

public interface UserService {
	
	User get(Long id);
	
	@Transactional
	void saveOrUpdate(User user);

	@Transactional
	void delete(User user);

	@Transactional
	void deleteAll();
	
	User getAccountByEmail(String email);
	
	User getAccountByLogin(String login);
	
	UserRole getRole(Long userId);
	
    List<User> getAllUser();

    List<User> getAllUserByName(String name);
    
    List<User> getAllUSersByRole(UserRole userRole);
	
//    List<User> getAllUsers(SingularAttribute<User, ?> attr, boolean ascending, int startRecord, int pageSize);
    
}
